﻿using System;
using System.Web.Mvc;
using Popw.LiveBlog.Services;

namespace Popw.LiveBlog.Models
{
	public class ContentItem
	{
		public int ContentItemID { get; set; }
		public string Name { get; set; }
		public string Content { get; set; }
		public DateTime PostTime { get; set; }
		public string Utc
		{
			get
			{
				var time = new DateTime(PostTime.Ticks, DateTimeKind.Unspecified);
				return time.ToString("o");
			}
			set { }
		}
		public string FormattedTime
		{
			get
			{
				var formatter = DependencyResolver.Current.GetService<ITimeFormattingService>();
				return formatter.GetFormattedTime(PostTime);
			}
			set { }
		} 
	}
}